CHARTS
Photo by Markus Spiske on Unsplash
The Earth started to rebel when the carbon in the atmosphere began to swell…
— Donna Maltz
In the US, each household produces 48 tons of greenhouse gases. Food produces about 8 tons of emissions per household, or about 17% of the total. Worldwide, new reports suggest that livestock agriculture produces around half of all man-made emissions. We have to change how we produce and consume food, not just for environmental reasons, but because this is an existential issue for humans.
Let’s examine the situation.
#Load data
url_root <- "https://raw.githubusercontent.com/UN-AVT/kamino-source/main/sources/0-shared/data/"
url_file <- "food-consumption-and-co2-emissions/food-consumption-and-co2-emissions.csv"
url <- paste0(url_root, url_file)
food_consumption <- read.csv(url)
food_consumption
#Select the top 10 countries by co2 emissions
country <- food_consumption %>% group_by(country)%>%summarise(total=sum(co2_emmission))%>%top_n(10)%>%select(1)
#create dataframe of top 10 countries
df <- food_consumption%>%select(1,2,4)%>% inner_join(country)
df
theme_opts <- theme(
text = element_text(family = "inconsolata", size = 16),
plot.title = element_text(margin = margin(b = 10), color = "#22222b",face = "bold",size = 17),
plot.subtitle = element_text(margin = margin(b = 25),color = "#22222b", size = 12),
plot.caption = element_text(margin = margin(t = 20),color = "#22222b", size = 10),
axis.text.x = element_text(color = "#22222b", margin = margin(t = 15)),
axis.text.y = element_text(color = "#22222b"),
panel.background = element_blank(),
panel.border = element_blank(),
panel.grid.major = element_blank(),
plot.background = element_rect(fill = "#e7e7e7"),
plot.margin = unit(c(1, 2, 1, 1), "cm"),
legend.position='none'
)
v1 <-
ggplot(data=df,aes(x = country, y = fct_reorder(food_category,co2_emmission))) +
geom_tile(aes(fill = co2_emmission), color = "#2b2b2b") +
geom_text(aes(label = co2_emmission), color = "#22292F") +
scale_fill_gradient(low = "#20b2aa", high = "#2072b2") +
labs(x = "",y = "",
title = "Top 10 countries with the highest CO2 emissions",
subtitle = "On which food category do they emit the highest level of CO2?",
caption = "Source:Tidy Tuesday\nVisualization: JuanmaMN (Twitter @Juanma_MN)") +
scale_x_discrete(position = "top") +
guides(fill = NULL) +
theme_bw() +
theme_opts
girafe(ggobj = v1, width_svg = 16, height_svg = 9,
options = list(opts_sizing(rescale = TRUE, width = 1.0)))